package com.js.basic.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.js.basic.mapper.BsContractAgreeMapper;
import com.js.basic.domain.BsContractAgree;
import com.js.basic.service.IBsContractAgreeService;

/**
 * 合同约定Service业务层处理
 * 
 * @author ruoyi
 * @date 20240709
 */
@Service
public class BsContractAgreeServiceImpl implements IBsContractAgreeService 
{
    @Autowired
    private BsContractAgreeMapper bsContractAgreeMapper;

    /**
     * 查询合同约定
     * 
     * @param agreeId 合同约定主键
     * @return 合同约定
     */
    @Override
    public BsContractAgree selectBsContractAgreeByAgreeId(Long agreeId)
    {
        return bsContractAgreeMapper.selectBsContractAgreeByAgreeId(agreeId);
    }

    /**
     * 查询合同约定列表
     * 
     * @param bsContractAgree 合同约定
     * @return 合同约定
     */
    @Override
    public List<BsContractAgree> selectBsContractAgreeList(BsContractAgree bsContractAgree)
    {
        return bsContractAgreeMapper.selectBsContractAgreeList(bsContractAgree);
    }

    /**
     * 新增合同约定
     * 
     * @param bsContractAgree 合同约定
     * @return 结果
     */
    @Override
    public int insertBsContractAgree(BsContractAgree bsContractAgree)
    {
        bsContractAgree.setCreateTime(DateUtils.getNowDate());
        return bsContractAgreeMapper.insertBsContractAgree(bsContractAgree);
    }

    /**
     * 修改合同约定
     * 
     * @param bsContractAgree 合同约定
     * @return 结果
     */
    @Override
    public int updateBsContractAgree(BsContractAgree bsContractAgree)
    {
        return bsContractAgreeMapper.updateBsContractAgree(bsContractAgree);
    }

    /**
     * 批量删除合同约定
     * 
     * @param agreeIds 需要删除的合同约定主键
     * @return 结果
     */
    @Override
    public int deleteBsContractAgreeByAgreeIds(Long[] agreeIds)
    {
        return bsContractAgreeMapper.deleteBsContractAgreeByAgreeIds(agreeIds);
    }

    /**
     * 删除合同约定信息
     * 
     * @param agreeId 合同约定主键
     * @return 结果
     */
    @Override
    public int deleteBsContractAgreeByAgreeId(Long agreeId)
    {
        return bsContractAgreeMapper.deleteBsContractAgreeByAgreeId(agreeId);
    }
}
